package com.bw.app.test;

import com.bw.utils.RedisUtil;
import com.bw.utils.ThreadPoolUtil;
import lombok.SneakyThrows;
import redis.clients.jedis.Jedis;

import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;

public class B {
    public static void main(String[] args) {
//        A a = new A<>() {
//
//        };
//        a.show();
        ThreadPoolExecutor threadPoolExecutor = ThreadPoolUtil.getThreadPoolExecutor();
        for (int i = 0; i < 1000; i++) {
            threadPoolExecutor.submit(new Runnable() {
                @Override
                public void run() {
                    Jedis jedis = RedisUtil.getJedis();
//                    jedis.close();
                    System.out.println(Thread.currentThread() + jedis.get("name"));
//                    jedis.expire("name",24*60);
                    jedis.close();
                }
            });

        }
        threadPoolExecutor.shutdown();


    }
}
